package com.aaa.controller;

import com.aaa.entity.TestResultFpa;
import com.aaa.service.TestResultFpaService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (TestResultFpa)表控制层
 *
 * @author
 * @since 2022-07-08 09:59:43
 */
@RestController
@RequestMapping("testResultFpa")
public class TestResultFpaController {
    /**
     * 服务对象
     */
    @Resource
    private TestResultFpaService testResultFpaService;

    /**
     * 分页查询
     *
     * @param testResultFpa 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    @GetMapping
    public ResponseEntity<Page<TestResultFpa>> queryByPage(TestResultFpa testResultFpa, PageRequest pageRequest) {
        return ResponseEntity.ok(this.testResultFpaService.queryByPage(testResultFpa, pageRequest));
    }

   /* *//**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     *//*
    @GetMapping("{id}")
    public ResponseEntity<TestResultFpa> queryById(@PathVariable("id")  id) {
        return ResponseEntity.ok(this.testResultFpaService.queryById(id));
    }*/

    /**
     * 新增数据
     *
     * @param testResultFpa 实体
     * @return 新增结果
     */
    @PostMapping
    public ResponseEntity<TestResultFpa> add(TestResultFpa testResultFpa) {
        return ResponseEntity.ok(this.testResultFpaService.insert(testResultFpa));
    }



}

